<template>
	<view class="content">
		<view class="con-top">
			<image src="../../static/icon/clock.png" style="width: 15px;height: 15px;margin: 0 10rpx 0 0;"></image>
			<view style="letter-spacing: 5px;">1分钟 <text> 60 </text>ms </view>
		</view>
		<view class="con-mid">
			<view
				style="position:absolute; text-align: center;left:20px;top:47px;background-color:#8b5838;padding: 10rpx 0;z-index:3;border-radius: 10rpx 0 0 10rpx;width: 55px;"
				@click="goDetail(0)">{{list[0].title}}</view>
			<view @click="goDetail(1)"
				style="left:54px;top:65px;background-color: #88a44d;position: absolute;height: 72px;writing-mode:vertical-rl;z-index: 2;text-align: center;">
				{{list[1].title}}
			</view>
			<view @click="goDetail(2)"
				style="position: absolute;left:20px;top: 137px;width:55px;text-align: center;background-color: #8b5838;z-index:3;padding: 10rpx 0;border-radius: 10rpx 0 0 10rpx;">
				{{list[2].title}}
			</view>
			<view @click="goDetail(3)"
				style="top:154px;left:54px;height: 80px;z-index:-1;text-align:center;writing-mode:vertical-rl;background-color: #88a44d;position: absolute;padding: 20rpx 10rpx;z-index:2">
				{{list[3].title}}
			</view>
			<view @click="goDetail(4)"
				style="position: absolute;background-color: #8b5838;padding: 10rpx 20rpx;bottom: 33px;left: 23px;width:60px;text-align: center;z-index:3">
				{{list[4].title}}
			</view>
			<view @click="goDetail(5)"
				style="position: absolute;background-color:#8b5838;writing-mode:vertical-rl;left:82px;top: 46px;z-index: 11;padding: 20rpx 10rpx;height: 60px;text-align: center;">
				{{list[5].title}}
			</view>
			<view @click="goDetail(6)"
				style="position: absolute;background-color: #88a44d;top:55px;right: 22px;z-index: 10;padding: 10rpx 20rpx;width: 120px;text-align: center;">
				{{list[6].title}}
			</view>
			<view @click="goDetail(7)"
				style="position: absolute;background-color: #8b5838;z-index: 9;writing-mode:vertical-rl;right: 75px;top: 46px;height:80px;text-align: center;">
				{{list[7].title}}
			</view>
			<view @click="goDetail(8)"
				style="position: absolute;width: 130px;text-align:center;background-color: #88a44d;top: 116px;right: 17px;z-index: 11;padding: 10rpx 20rpx;font-size:10px;border-radius: 0 10rpx 10rpx 10rpx;">
				{{list[8].title}}
			</view>
			<view @click="goDetail(9)"
				style="position: absolute;background-color: #8b5838;bottom:124px;font-size: 10px;right: 22px;width: 130px;text-align: center;">
				{{list[9].title}}
			</view>
			<view @click="goDetail(10)"
				style="position: absolute;background-color: #88a44d;bottom:74px;left: 80px;z-index: 11;writing-mode:vertical-rl;border-radius:10rpx 0 0 10rpx;height: 64px;text-align: center">
				{{list[10].title}}
			</view>
			<view @click="goDetail(11)"
				style="position: absolute;background-color: #8b5838;bottom:74px;font-size: 10px;right: 22px;width: 130px;text-align: center;">
				{{list[11].title}}
			</view>
			<view @click="goDetail(12)"
				style="position: absolute;background-color: #88a44d;bottom:74px;right: 20px;z-index: 11;writing-mode:vertical-rl;border-radius:0 10rpx 10rpx 0;height: 64px;text-align: center">
				{{list[12].title}}
			</view>
			<view @click="goDetail(13)"
				style="position: absolute;background-color: #88a44d;bottom: 33px;right: 16px;z-index: 11;border-radius: 0 10rpx 10rpx 0;padding: 10rpx 0;width: 130px;text-align: center;">
				{{list[13].title}}
			</view>
		</view>
		<view
			style="display: flex;align-items: center;position: absolute;bottom: 8px;justify-content: center;width: 100%;"
			@click="goReport">
			<image src="../../static/icon/report.png" style="width: 12px;height: 12px;"></image>
			<view style="color: #9e9e9e;">报告</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			// uni.clearStorage()
			if (uni.getStorageSync('report')) {
				this.list = uni.getStorageSync('report')
			} else {
				this.list = [{
				value: 0,
					title: "规划"
				}, {
					value: 1,
					title: "跳绳"
				}, {
					value:2,
					title: "卫生"
				}, {
					value: 3,
					title: "我的人生"
				}, {
					value: 4,
					title: "课间运动"
				}, {
					value: 5,
					title: "效率"
				}, {
					value: 6,
					title: "自我批判方法"
				}, {
					value:7,
					title: "冥想"
				}, {
					value: 8,
					title: "洞察学霸素质"
				}, {
					value: 9,
					title: "检查作业"
				}, {
					value: 10,
					title: "英语单词"
				}, {
					value: 11,
					title: "整理书包"
				}, {
					value: 12,
					title: "背篇古文"
				}, {
					value: 13,
					title: "远眺户外"
				}]
				//存缓存
				uni.setStorageSync(
					"report",
					this.list
				);
			}

		},
		methods: {
			goDetail(i) {
				uni.navigateTo({
					url: `/pages/timer/detail?index=${i}`
				});
			},
			goReport() {
				uni.navigateTo({
					url: "/pages/timer/report"
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		font-size: 36rpx;
		padding: 60rpx 30rpx 0 30rpx;

		.con-top {
			font-size: 40rpx;
			display: flex;
			align-items: center;
			color: #ebd343;
			justify-content: center;

			text {
				color: #9e9e9e;
			}
		}

		.con-mid {
			margin: 16rpx 0 0 0;

			text,
			view {
				padding: 10rpx;
				border-radius: 10rpx;
			}
		}
	}
</style>